<?php
namespace app\member\controller;

class Home extends Common
{
    public function index()
    {	
    	$balance = db('admin_member')->where(['id'=>$this->info['id']])->value('balance');
    	$loan_export_record = db('loan_export_record')->where(['uid'=>$this->info['id']])->count();
    	$loan_info_count = db('loan_info')->count();

        //扣取总金额
        $cat_price = db('amount_log')->where(['user_id'=>$this->info['id'],'type'=>'-1'])->sum('price');
    	$this->assign('balance',$balance);
        $this->assign('loan_info_count',$loan_info_count);
    	$this->assign('cat_price',$cat_price);
    	$this->assign('loan_export_record',$loan_export_record);
        return $this->fetch();
    }
}
